package com.ruoyi.project.NH.average_income_comparison.controller;

import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.framework.web.page.PageDomain;
import com.ruoyi.framework.web.page.TableSupport;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.NH.average_income_comparison.domain.AverageIncomeInfo;
import com.ruoyi.project.NH.average_income_comparison.service.IAverageIncomeInfoService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;

/**
 * 户收入对比Controller
 * 
 * @author 狗熊岭
 * @date 2023-08-05
 */
@RestController
@RequestMapping("/NH/average_income_comparison")
public class AverageIncomeInfoController extends BaseController
{
    @Autowired
    private IAverageIncomeInfoService averageIncomeInfoService;

    /**
     * 查询户收入对比列表
     */
    @PreAuthorize("@ss.hasPermi('NH:average_income_comparison:list')")
    @GetMapping("/list")
    public TableDataInfo list(AverageIncomeInfo averageIncomeInfo)
    {
        startPage();
        List<AverageIncomeInfo> list = averageIncomeInfoService.findBackIntoPoverty(averageIncomeInfo);
        return getDataTable(list);
    }



    /**
     * 获取户收入对比详细信息
     */
    @PreAuthorize("@ss.hasPermi('NH:average_income_comparison:query')")
    @GetMapping(value = "/{fid}")
    public AjaxResult getInfo(@PathVariable("fid") String fid)
    {
        return success(averageIncomeInfoService.selectAverageIncomeInfoByFid(fid));
    }


}
